package com.kaluli.project.repository.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.kaluli.project.domain.entity.KllOrderDataVo;
import com.kaluli.project.domain.entity.KllUserDataVo;
import com.kaluli.project.domain.entity.StockVO;
import com.kaluli.project.domain.repository.KllDataRepository;
import com.kaluli.project.domain.repository.KllStockRepository;
import com.kaluli.system.repository.AbstractRepositorySupport;

@Repository
public class KllStockRepositoryImpl extends AbstractRepositorySupport<StockVO> implements KllStockRepository{

	@Override
	protected Class<StockVO> getEntityClass() {
		// TODO Auto-generated method stub
		return StockVO.class;
	}

	
	@Override
	public List<StockVO> findStockNum() {
		StringBuffer sql = new StringBuffer("SELECT i.`title` as itemName ,concat(i.`id`,'-',s.`id` ) as idConcat,s.`total_num` as totalNum,s.`id`   FROM `kll_item` i ,  `kll_item_sku` s where  i.`id` =s.`item_id` and s.`total_num` <=5 and s.`status` =0 and i.`status`= 3 ");
		
		List<StockVO> list = excuteSql(sql.toString());
		
		return list;
	}
	
	
	

}
